package com.sk.bilibili.covert;

import com.sk.bilibili.bean.Danmu;
import com.sk.bilibili.dto.FakeDanmu;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author 邵康
 * @date 2021/11/26 19:41
 */
@Mapper
public interface DanmuCovert {

    DanmuCovert INSTANCE = Mappers.getMapper(DanmuCovert.class);

    @Mapping(target = "videoId", source = "id")
    @Mapping(target = "memberId", source = "author")
    @Mapping(target = "content", source = "text")
    Danmu toDanmu(FakeDanmu fakeDanmu);

}
